package com.tedu.review.test;

public class 作业2 {
    public static void main(String[] args) {
      Animal animal=new Animal(){
          public void eat() {
              System.out.println("吃");
          }
          public void sleep() {
              System.out.println("睡");
          }
      };
      animal.eat();
      animal.sleep();
    }
}
abstract class Animal{
    public abstract void eat();
    public abstract void sleep();
}
